const sequelize = require("./db");
const { DataTypes } = require("sequelize");

const User = sequelize.define("user", {
  name: {
    type: DataTypes.STRING,
    defaultValue: "新用户"
  },
  account: {
    type: DataTypes.STRING,
    defaultValue: "abcd1234"
  },
  password: {
    type: DataTypes.STRING,
    defaultValue: "123123"
  },
  user_right: {
    type: DataTypes.TINYINT,
    defaultValue: 0
  },
  tel: {
    type: DataTypes.STRING(11),
  },
  avatar_url: {
    type: DataTypes.STRING,
    defaultValue: "/static/default_avatar.png"
  },
}, {
  tableName: "user",
  createdAt: false,
  updatedAt: false,
  paranoid: false
});

module.exports = User;